require('./PageBusiness.styl');
import { Control } from 'react-keeper'
const Panel = require('components/panel');
if (!window.isBp) {
    //    var paths = [{ path: "tender", title: "招标", id: 'index0' },{ path: "workplan", title: "计划管理", id: 'index1' }, { path: "achievements", title: "成果管理", id: 'index2' }, { path: "payment", title: "支付管理", id: 'index3' }, { path: "maintenance", title: "维护支持", id: 'index4' },{ path: "schedule", title: "进度", id: 'index5' }];//招标,计划，成果，支付，维护,进度
     var paths = [{ path: "workplan", title: "计划管理", id: 'index0' }, { path: "achievements", title: "成果管理", id: 'index1' }, { path: "payment", title: "支付管理", id: 'index2' }, { path: "maintenance", title: "维护支持", id: 'index3' }];//计划，成果，支付，维护
}else {
    var paths = [{ path: "tender", title: "招标", id: 'index0' },{ path: "achievements", title: "成果管理", id: 'index1' }, { path: "payment", title: "支付管理", id: 'index2' },{ path: "schedule", title: "进度", id: 'index3' }];//招标,计划，成果，支付，维护,进度
}

class Business extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
        };
        this.handleClick = this.handleClick.bind(this);
    }
    handleClick(path) {
        Control.go(`/home/${path}`)
    }
    render() {

        return (
            <div className="business">
                {paths.map((item, index) => {
                    const ContentSvg = require(`images/svg/mangement/${item.path}.svg`);
                    return (<Panel title={item.title} Key={item.path} cb={this.handleClick}>
                        <ContentSvg className="content-svg t-MT3"/>
                    </Panel>);
                })
                }
            </div>
        );
    }

    componentWillMount() {
    }

    componentDidMount() {
    }

    componentWillReceiveProps(nextProps) {
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {
    }

    componentDidUpdate(prevProps, prevState) {
    }

    componentWillUnmount() {
    }
}

module.exports = Business;
